package com.wpre.lotterysystem.service.dto;

import com.wpre.lotterysystem.service.enums.ActivityPrizeStatusEnum;
import com.wpre.lotterysystem.service.enums.ActivityStatusEnum;
import com.wpre.lotterysystem.service.enums.ActivityTiersEnum;
import com.wpre.lotterysystem.service.enums.ActivityUserStatusEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:活动详情
 * User: LianBao
 * Date: 2024-12-21
 * Time: 19:35
 */
@Data
public class ActivityDetailDTO {
    //活动信息
    private Long activityId;//活动id
    private String activityName;//活动名称
    private String desc;//活动描述
    private ActivityStatusEnum status;//活动状态
    //奖品信息(列表)
    private List<PrizeDetailDTO> prizeDTOList;

    //人员信息
    private List<UserDetailDTO> userDetailDTOList;


    public Boolean valid() {
        return status.equals(ActivityStatusEnum.RUNNING);
    }


    @Data
    public static class PrizeDetailDTO {
        private Long prizeId;//奖品id
        private String name;//奖品名称
        private String imageUrl;//图片索引
        private BigDecimal price;//价格
        private String description;//描述
        private ActivityTiersEnum tiers;//奖品等级
        private Long prizeAmount;//奖品数量
        private ActivityPrizeStatusEnum status;//奖品状态

        public Boolean valid() {
            return status.equals(ActivityPrizeStatusEnum.INIT);
        }
    }

    @Data
    public static class UserDetailDTO {
        private Long userId;//用户id
        private String userName;//姓名
        private ActivityUserStatusEnum status;//状态
        public Boolean valid() {
            return status.equals(ActivityUserStatusEnum.INIT);
        }
    }

}
